/* Pipeline dashboard styles — AnoviaFlow brand (warm tones, Instrument Serif/Sans) */

.page-header {
  padding: 40px 48px 32px;
  border-bottom: 1px solid var(--border);
}
.page-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.page-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--fg-muted);
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--border); }

.btn-outline-sm {
  display: inline-block;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
}
.btn-outline-sm:hover { background: var(--surface); color: var(--fg); }

.btn-sm {
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-progress { background: #D97706; color: #fff; }
.btn-deliver  { background: #059669; color: #fff; }
.btn-queue    { background: var(--surface); color: var(--fg); border: 1px solid var(--border); }
.btn-danger   { background: transparent; color: #DC2626; border: 1px solid #DC2626; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg-muted);
  padding: 4px 6px;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface); color: var(--fg); }
.icon-btn.danger:hover { background: #FEF2F2; color: #DC2626; }

/* Stats Bar */
.pipeline-layout { padding: 0 48px 48px; }
.stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 32px 0 0;
}
.stat-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.stat-value.accent { color: var(--accent); }
.stat-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin-right: 32px;
}

/* Client List */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.client-card {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.client-card:last-child { border-bottom: 1px solid var(--border); }
.client-card:hover { background: var(--surface); }

.client-card-left {
  flex: 1;
  padding: 20px 24px;
  min-width: 0;
}
.client-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 6px;
}
.client-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.client-id {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: monospace;
}

.client-card-right {
  padding: 20px 24px;
  flex: 1.5;
  min-width: 0;
}

.request-info {}
.request-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.request-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-add-request {
  background: none;
  border: 1px dashed var(--border);
  color: var(--fg-muted);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-add-request:hover { border-color: var(--accent); color: var(--accent); }

.client-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 16px 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.client-card:hover .client-card-actions { opacity: 1; }

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-queued    { background: var(--surface); color: var(--fg-muted); border: 1px solid var(--border); }
.status-in_progress { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.status-delivered { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }

/* Plan Badges */
.plan-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plan-badge.starter   { background: var(--surface); color: var(--fg-muted); }
.plan-badge.growth    { background: #EFF6FF; color: #1D4ED8; }
.plan-badge.premium   { background: #F5F3FF; color: #6D28D9; }
.plan-badge.enterprise { background: #FEF3C7; color: #92400E; }

/* Clock */
.clock {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.clock-none  { color: var(--fg-muted); }
.clock-ok    { color: var(--fg-muted); }
.clock-warning { color: #D97706; }
.clock-urgent { color: #DC2626; font-weight: 600; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--fg); }

#client-form, #request-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--fg); }
.form-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); }
textarea.form-input { resize: vertical; min-height: 80px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

/* Detail Slide-in */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.3);
  z-index: 200;
}
.detail-overlay.open { display: block; }
.detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.detail-overlay.open .detail-panel { transform: translateX(0); }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.detail-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.detail-body { padding: 0; }
.detail-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 14px;
}
.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}
.detail-sep { color: var(--border); }
.detail-empty {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
}

.contact-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.contact-item:last-child { border-bottom: none; }
.contact-name { font-size: 14px; font-weight: 500; color: var(--fg); }
.contact-email, .contact-phone { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

.request-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.request-item:last-of-type { border-bottom: none; }
.request-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.request-item-title { font-size: 14px; font-weight: 500; color: var(--fg); margin-bottom: 4px; }
.request-item-desc { font-size: 13px; color: var(--fg-muted); line-height: 1.5; }
.request-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* States */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--fg-muted);
  font-size: 14px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  text-align: center;
}
.empty-icon { font-size: 32px; color: var(--border); }

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 768px) {
  .page-header { padding: 24px; }
  .pipeline-layout { padding: 0 24px 40px; }
  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .client-card { flex-wrap: wrap; }
  .client-card-right { flex: 1 1 100%; padding-top: 0; border-top: 1px solid var(--border); margin-top: 12px; }
  .detail-panel { width: 100%; }
}