/* ITS CRM custom styles. */

:root {
  --crm-brand: #0d6efd;
}

body {
  background-color: #fafafb;
}

.navbar-brand {
  letter-spacing: 0.02em;
}

/* Data table */
.data-table {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.data-table th {
  white-space: nowrap;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  background: #f8f9fa;
}

.data-table th a.sort-link {
  color: inherit;
  text-decoration: none;
}

.data-table th a.sort-link:hover {
  color: var(--crm-brand);
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hidden-col {
  display: none !important;
}

/* Status pills */
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-pill.status-lead,
.status-pill-select.status-lead         { background-color: #e7f1ff; color: #0d6efd; }
.status-pill.status-negotiation,
.status-pill-select.status-negotiation  { background-color: #fff4e0; color: #b16a00; }
.status-pill.status-kp_sent,
.status-pill-select.status-kp_sent      { background-color: #ede7ff; color: #6f42c1; }
.status-pill.status-closed,
.status-pill-select.status-closed       { background-color: #e6f7ec; color: #198754; }
.status-pill.status-rejected,
.status-pill-select.status-rejected     { background-color: #ffebee; color: #c82333; }

/* Inline-editable status select inside data tables. */
.status-pill-select {
  display: inline-block;
  width: auto;
  min-width: 9rem;
  padding: 0.15rem 1.75rem 0.15rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.65rem 0.65rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.status-pill-select:focus {
  outline: 0;
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
  border-color: rgba(13, 110, 253, 0.5);
}

.status-pill-select:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Mobile usability — sticky first column on tables */
@media (max-width: 768px) {
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
