/* ── Filters Bar ── */
.filters-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}
.stats-bar {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #36454F;
}
.stat-item { font-weight: 600; }
.stat-item span { color: #1a1a1a; font-size: 1.1rem; }

/* ── Kanban Board ── */
.kanban-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 500px;
}
.kanban-column {
  min-width: 220px;
  max-width: 260px;
  flex: 1;
  background: #f5f5f5;
  border-radius: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}
.kanban-column-header {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #36454F;
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 0.5rem;
}
.kanban-count {
  background: #e0e0e0;
  border-radius: 12px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.kanban-cards {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.kanban-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-color: #f9c248;
}
.kanban-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #1a1a1a;
}
.kanban-card-sub {
  font-size: 0.78rem;
  color: #36454F;
  margin-bottom: 0.25rem;
}
.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.4rem;
}
.kanban-card-num {
  font-weight: 700;
  color: #f9c248;
  font-size: 0.78rem;
}

/* ── Status colours on kanban column headers ── */
.kanban-column[data-status="new"] .kanban-column-header { border-bottom-color: #2563eb; }
.kanban-column[data-status="under_review"] .kanban-column-header { border-bottom-color: #f9c248; }
.kanban-column[data-status="on_hold"] .kanban-column-header { border-bottom-color: #e67e22; }
.kanban-column[data-status="approved"] .kanban-column-header { border-bottom-color: #27ae60; }
.kanban-column[data-status="agreement_sent"] .kanban-column-header { border-bottom-color: #8e44ad; }
.kanban-column[data-status="agreement_signed"] .kanban-column-header { border-bottom-color: #0e8c6e; }
.kanban-column[data-status="onboarded"] .kanban-column-header { border-bottom-color: #27ae60; }
.kanban-column[data-status="expired"] .kanban-column-header { border-bottom-color: #95a5a6; }
.kanban-column[data-status="rejected"] .kanban-column-header { border-bottom-color: #c0392b; }

/* ── Status pills ── */
.status-new { background: rgba(53,112,255,0.12); color: #2563eb; }
.status-under_review { background: rgba(241,196,15,0.12); color: #b8860b; }
.status-on_hold { background: rgba(230,126,34,0.12); color: #a34200; }
.status-approved { background: rgba(46,204,113,0.12); color: #27ae60; }
.status-agreement_sent { background: rgba(155,89,182,0.12); color: #8e44ad; }
.status-agreement_signed { background: rgba(26,188,156,0.12); color: #0e8c6e; }
.status-onboarded { background: rgba(46,204,113,0.2); color: #1a8a4a; }
.status-expired { background: rgba(149,165,166,0.12); color: #7f8c8d; }
.status-rejected { background: rgba(231,76,60,0.12); color: #c0392b; }

/* ── Table View ── */
.table-view { overflow-x: auto; }
.table-view table { font-size: 0.9rem; }
.table-view tbody tr { cursor: pointer; transition: background 0.15s; }
.table-view tbody tr:hover { background: #f9f9f9; }
.table-actions { display: flex; gap: 0.3rem; }

/* ── Modal Details ── */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.detail-header h2 { margin: 0; font-size: 1.3rem; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 0.2rem;
}
.detail-field .value {
  font-size: 0.95rem;
  color: #1a1a1a;
  word-break: break-word;
}
.detail-field input,
.detail-field select,
.detail-field textarea {
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
}
.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  padding-top: 1rem;
  border-top: 2px solid #f9c248;
}
.detail-section {
  margin-top: 1.5rem;
}
.detail-section h3 {
  font-size: 0.9rem;
  color: #36454F;
  margin-bottom: 0.75rem;
}

/* History timeline */
.history-list {
  list-style: none;
  padding: 0;
}
.history-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}
.history-time {
  color: #888;
  white-space: nowrap;
  min-width: 130px;
}
.history-action {
  font-weight: 600;
  color: #1a1a1a;
}
.history-actor {
  color: #36454F;
  margin-left: auto;
}

/* ── Action modal ── */
.action-form { margin-top: 1rem; }
.action-form h3 { margin-bottom: 1rem; }
.action-form .form-group { margin-bottom: 1rem; }
.action-form .btn { margin-top: 0.5rem; }

/* ── Tier select grid ── */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}
.tier-option {
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.tier-option:hover { border-color: #f9c248; }
.tier-option.selected { border-color: #f9c248; background: rgba(249,194,72,0.1); }
.tier-option .tier-name {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
}
.tier-option .tier-discount {
  font-size: 0.8rem;
  color: #36454F;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .kanban-board { flex-direction: column; }
  .kanban-column { max-width: none; min-width: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
}
