// =============================================================
// Customer Portal – Styles composants (SCSS)
// Les tokens de design et classes utilitaires Tailwind
// sont définis dans styles/portal.css
// =============================================================

// ── Composants ──────────────────────────────────────────────
@use 'components/sidebar';
@use 'components/text-editor';

// ── Layout ──────────────────────────────────────────────────

// Card principale : empêche le border-radius d'être coupé par
// les éléments enfants positionnés (table, sticky header…)
.cp-card {
  isolation: isolate;
}

// ── Table portal ────────────────────────────────────────────

.cp-table {
  width: 100%;
  border-collapse: collapse;

  thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #848484;
    padding: 0.75rem 1rem;
    text-align: left;
    background: #F5F5F5;
    white-space: nowrap;

    &:first-child { border-radius: 0; }
  }

  tbody tr {
    border-bottom: 1px solid #d2d2d2;
    transition: background 0.15s ease;

    &:last-child { border-bottom: none; }
    &:hover      { background: #E4F7FC40; }
  }

  td {
    padding: 1rem;
    font-size: 0.875rem;
    color: #282828;
    vertical-align: middle;
  }
}

// ── Filtres / Pills ─────────────────────────────────────────

.cp-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid #d2d2d2;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  background: #fff;
  color: #034A5E;

  &:hover,
  &.active {
    border-color: #33A0BE;
    background: #33A0BE;
    color: #fff;
  }

  // Variante gradient (premier pill actif)
  &.active-gradient {
    border-color: transparent;
    background: linear-gradient(90deg, #33A0BE 0%, #1BCEC8 54.4%, #00FFD3 100%);
    color: #fff;
  }
}

// ── Badge statut ─────────────────────────────────────────────

.cp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;

  &::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }
}

// ── Avatar commercial ────────────────────────────────────────

.cp-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

// ── Bouton CTA portal ────────────────────────────────────────

.cp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  border: 1.5px solid #33A0BE;
  background: transparent;
  color: #33A0BE;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;

  &:hover {
    background: #33A0BE;
    color: #fff;
  }
}
